import {reactive} from 'vue'
import axios from 'axios'

export default function () {
    let array = reactive([
        'https://images.dog.ceo/breeds/pembroke/n02113023_10829.jpg'
    ])

    async function addDog() {
        try {
            let result = await axios.get('https://dog.ceo/api/breed/pembroke/images/random');
            array.push(result.data.message)
        } catch (e) {
            alert(e)
        }
    }
    return {array, addDog}
};